# include "AnisotropicSamplerBindAble.h"
# include "d3d11.h"

AnisotropicSamplerBindAble::AnisotropicSamplerBindAble(ID3D11Device* _device)
{
	// 采样器
	D3D11_SAMPLER_DESC samplerDesc = {};
	samplerDesc.Filter = D3D11_FILTER::D3D11_FILTER_ANISOTROPIC;
	samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
	samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
	samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
	samplerDesc.MaxAnisotropy = 16;
	_device->CreateSamplerState(&samplerDesc, this->m_sampler.GetAddressOf());
}

void AnisotropicSamplerBindAble::bind(ID3D11DeviceContext* _context)
{
	_context->PSSetSamplers(0, 1, this->m_sampler.GetAddressOf());
}

AnisotropicSamplerBindAble::~AnisotropicSamplerBindAble()
{

}
